import 'package:flutter_ncsjqz_getx/generated/json/base/json_convert_content.dart';
import 'package:flutter_ncsjqz_getx/model/commodity_list_entity.dart';

CommodityListEntity $CommodityListEntityFromJson(Map<String, dynamic> json) {
	final CommodityListEntity commodityListEntity = CommodityListEntity();
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		commodityListEntity.msg = msg;
	}
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		commodityListEntity.code = code;
	}
	final CommodityListData? data = jsonConvert.convert<CommodityListData>(json['data']);
	if (data != null) {
		commodityListEntity.data = data;
	}
	return commodityListEntity;
}

Map<String, dynamic> $CommodityListEntityToJson(CommodityListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	data['data'] = entity.data?.toJson();
	return data;
}

CommodityListData $CommodityListDataFromJson(Map<String, dynamic> json) {
	final CommodityListData commodityListData = CommodityListData();
	final List<CommodityListDataContent>? content = jsonConvert.convertListNotNull<CommodityListDataContent>(json['content']);
	if (content != null) {
		commodityListData.content = content;
	}
	final CommodityListDataPageable? pageable = jsonConvert.convert<CommodityListDataPageable>(json['pageable']);
	if (pageable != null) {
		commodityListData.pageable = pageable;
	}
	final int? totalElements = jsonConvert.convert<int>(json['totalElements']);
	if (totalElements != null) {
		commodityListData.totalElements = totalElements;
	}
	final bool? last = jsonConvert.convert<bool>(json['last']);
	if (last != null) {
		commodityListData.last = last;
	}
	final int? totalPages = jsonConvert.convert<int>(json['totalPages']);
	if (totalPages != null) {
		commodityListData.totalPages = totalPages;
	}
	final bool? first = jsonConvert.convert<bool>(json['first']);
	if (first != null) {
		commodityListData.first = first;
	}
	final CommodityListDataSort? sort = jsonConvert.convert<CommodityListDataSort>(json['sort']);
	if (sort != null) {
		commodityListData.sort = sort;
	}
	final int? numberOfElements = jsonConvert.convert<int>(json['numberOfElements']);
	if (numberOfElements != null) {
		commodityListData.numberOfElements = numberOfElements;
	}
	final int? size = jsonConvert.convert<int>(json['size']);
	if (size != null) {
		commodityListData.size = size;
	}
	final int? number = jsonConvert.convert<int>(json['number']);
	if (number != null) {
		commodityListData.number = number;
	}
	final bool? empty = jsonConvert.convert<bool>(json['empty']);
	if (empty != null) {
		commodityListData.empty = empty;
	}
	return commodityListData;
}

Map<String, dynamic> $CommodityListDataToJson(CommodityListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['content'] =  entity.content?.map((v) => v.toJson()).toList();
	data['pageable'] = entity.pageable?.toJson();
	data['totalElements'] = entity.totalElements;
	data['last'] = entity.last;
	data['totalPages'] = entity.totalPages;
	data['first'] = entity.first;
	data['sort'] = entity.sort?.toJson();
	data['numberOfElements'] = entity.numberOfElements;
	data['size'] = entity.size;
	data['number'] = entity.number;
	data['empty'] = entity.empty;
	return data;
}

CommodityListDataContent $CommodityListDataContentFromJson(Map<String, dynamic> json) {
	final CommodityListDataContent commodityListDataContent = CommodityListDataContent();
	final int? commodityId = jsonConvert.convert<int>(json['commodityId']);
	if (commodityId != null) {
		commodityListDataContent.commodityId = commodityId;
	}
	final int? shopId = jsonConvert.convert<int>(json['shopId']);
	if (shopId != null) {
		commodityListDataContent.shopId = shopId;
	}
	final String? acreage = jsonConvert.convert<String>(json['acreage']);
	if (acreage != null) {
		commodityListDataContent.acreage = acreage;
	}
	final String? commodityName = jsonConvert.convert<String>(json['commodityName']);
	if (commodityName != null) {
		commodityListDataContent.commodityName = commodityName;
	}
	final String? masterPic = jsonConvert.convert<String>(json['masterPic']);
	if (masterPic != null) {
		commodityListDataContent.masterPic = masterPic;
	}
	final int? price = jsonConvert.convert<int>(json['price']);
	if (price != null) {
		commodityListDataContent.price = price;
	}
	final double? distance = jsonConvert.convert<double>(json['distance']);
	if (distance != null) {
		commodityListDataContent.distance = distance;
	}
	final int? originalPrice = jsonConvert.convert<int>(json['originalPrice']);
	if (originalPrice != null) {
		commodityListDataContent.originalPrice = originalPrice;
	}
	final dynamic? shopName = jsonConvert.convert<dynamic>(json['shopName']);
	if (shopName != null) {
		commodityListDataContent.shopName = shopName;
	}
	final String? brief = jsonConvert.convert<String>(json['brief']);
	if (brief != null) {
		commodityListDataContent.brief = brief;
	}
	final int? status = jsonConvert.convert<int>(json['status']);
	if (status != null) {
		commodityListDataContent.status = status;
	}
	final int? categoryId = jsonConvert.convert<int>(json['categoryId']);
	if (categoryId != null) {
		commodityListDataContent.categoryId = categoryId;
	}
	final int? parentCategoryId = jsonConvert.convert<int>(json['parentCategoryId']);
	if (parentCategoryId != null) {
		commodityListDataContent.parentCategoryId = parentCategoryId;
	}
	final int? soldNum = jsonConvert.convert<int>(json['soldNum']);
	if (soldNum != null) {
		commodityListDataContent.soldNum = soldNum;
	}
	final int? totalStocks = jsonConvert.convert<int>(json['totalStocks']);
	if (totalStocks != null) {
		commodityListDataContent.totalStocks = totalStocks;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		commodityListDataContent.content = content;
	}
	final String? deliveryAddress = jsonConvert.convert<String>(json['deliveryAddress']);
	if (deliveryAddress != null) {
		commodityListDataContent.deliveryAddress = deliveryAddress;
	}
	final dynamic? shopPic = jsonConvert.convert<dynamic>(json['shopPic']);
	if (shopPic != null) {
		commodityListDataContent.shopPic = shopPic;
	}
	final dynamic? skuList = jsonConvert.convert<dynamic>(json['skuList']);
	if (skuList != null) {
		commodityListDataContent.skuList = skuList;
	}
	final dynamic? masterUrls = jsonConvert.convert<dynamic>(json['masterUrls']);
	if (masterUrls != null) {
		commodityListDataContent.masterUrls = masterUrls;
	}
	final dynamic? slaveUrls = jsonConvert.convert<dynamic>(json['slaveUrls']);
	if (slaveUrls != null) {
		commodityListDataContent.slaveUrls = slaveUrls;
	}
	final dynamic? props = jsonConvert.convert<dynamic>(json['props']);
	if (props != null) {
		commodityListDataContent.props = props;
	}
	return commodityListDataContent;
}

Map<String, dynamic> $CommodityListDataContentToJson(CommodityListDataContent entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['commodityId'] = entity.commodityId;
	data['shopId'] = entity.shopId;
	data['acreage'] = entity.acreage;
	data['commodityName'] = entity.commodityName;
	data['masterPic'] = entity.masterPic;
	data['price'] = entity.price;
	data['distance'] = entity.distance;
	data['originalPrice'] = entity.originalPrice;
	data['shopName'] = entity.shopName;
	data['brief'] = entity.brief;
	data['status'] = entity.status;
	data['categoryId'] = entity.categoryId;
	data['parentCategoryId'] = entity.parentCategoryId;
	data['soldNum'] = entity.soldNum;
	data['totalStocks'] = entity.totalStocks;
	data['content'] = entity.content;
	data['deliveryAddress'] = entity.deliveryAddress;
	data['shopPic'] = entity.shopPic;
	data['skuList'] = entity.skuList;
	data['masterUrls'] = entity.masterUrls;
	data['slaveUrls'] = entity.slaveUrls;
	data['props'] = entity.props;
	return data;
}

CommodityListDataPageable $CommodityListDataPageableFromJson(Map<String, dynamic> json) {
	final CommodityListDataPageable commodityListDataPageable = CommodityListDataPageable();
	final CommodityListDataPageableSort? sort = jsonConvert.convert<CommodityListDataPageableSort>(json['sort']);
	if (sort != null) {
		commodityListDataPageable.sort = sort;
	}
	final int? pageNumber = jsonConvert.convert<int>(json['pageNumber']);
	if (pageNumber != null) {
		commodityListDataPageable.pageNumber = pageNumber;
	}
	final int? pageSize = jsonConvert.convert<int>(json['pageSize']);
	if (pageSize != null) {
		commodityListDataPageable.pageSize = pageSize;
	}
	final int? offset = jsonConvert.convert<int>(json['offset']);
	if (offset != null) {
		commodityListDataPageable.offset = offset;
	}
	final bool? paged = jsonConvert.convert<bool>(json['paged']);
	if (paged != null) {
		commodityListDataPageable.paged = paged;
	}
	final bool? unpaged = jsonConvert.convert<bool>(json['unpaged']);
	if (unpaged != null) {
		commodityListDataPageable.unpaged = unpaged;
	}
	return commodityListDataPageable;
}

Map<String, dynamic> $CommodityListDataPageableToJson(CommodityListDataPageable entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sort'] = entity.sort?.toJson();
	data['pageNumber'] = entity.pageNumber;
	data['pageSize'] = entity.pageSize;
	data['offset'] = entity.offset;
	data['paged'] = entity.paged;
	data['unpaged'] = entity.unpaged;
	return data;
}

CommodityListDataPageableSort $CommodityListDataPageableSortFromJson(Map<String, dynamic> json) {
	final CommodityListDataPageableSort commodityListDataPageableSort = CommodityListDataPageableSort();
	final bool? sorted = jsonConvert.convert<bool>(json['sorted']);
	if (sorted != null) {
		commodityListDataPageableSort.sorted = sorted;
	}
	final bool? unsorted = jsonConvert.convert<bool>(json['unsorted']);
	if (unsorted != null) {
		commodityListDataPageableSort.unsorted = unsorted;
	}
	final bool? empty = jsonConvert.convert<bool>(json['empty']);
	if (empty != null) {
		commodityListDataPageableSort.empty = empty;
	}
	return commodityListDataPageableSort;
}

Map<String, dynamic> $CommodityListDataPageableSortToJson(CommodityListDataPageableSort entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sorted'] = entity.sorted;
	data['unsorted'] = entity.unsorted;
	data['empty'] = entity.empty;
	return data;
}

CommodityListDataSort $CommodityListDataSortFromJson(Map<String, dynamic> json) {
	final CommodityListDataSort commodityListDataSort = CommodityListDataSort();
	final bool? sorted = jsonConvert.convert<bool>(json['sorted']);
	if (sorted != null) {
		commodityListDataSort.sorted = sorted;
	}
	final bool? unsorted = jsonConvert.convert<bool>(json['unsorted']);
	if (unsorted != null) {
		commodityListDataSort.unsorted = unsorted;
	}
	final bool? empty = jsonConvert.convert<bool>(json['empty']);
	if (empty != null) {
		commodityListDataSort.empty = empty;
	}
	return commodityListDataSort;
}

Map<String, dynamic> $CommodityListDataSortToJson(CommodityListDataSort entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sorted'] = entity.sorted;
	data['unsorted'] = entity.unsorted;
	data['empty'] = entity.empty;
	return data;
}